[XEN] Truncate arithmetic for PERFSTATUS counters to the width of perfc_t.
authorTim Deegan <Tim.Deegan@xensource.com>
Tue, 24 Apr 2007 10:39:13 +0000 (11:39 +0100)
committerTim Deegan <Tim.Deegan@xensource.com>
Tue, 24 Apr 2007 10:39:13 +0000 (11:39 +0100)
commitd2158ada297628242fb87863c11bf25e1031193e
treec24ee98cdf964799b94be5e6380b6d3c81283256
parent7f804c918cc7078909c50917cd1b89c9264f344a
[XEN] Truncate arithmetic for PERFSTATUS counters to the width of perfc_t.
Since these are all calculated per-cpu now, a status counter that is
incremented on one cpu and decremented on another will underflow on
the decrement.  When we add the per-cpu values to get the total, if
we don't truncate the sum it will be max-perfc + 1 instead of zero.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen/common/perfc.c